home *** CD-ROM | disk | FTP | other *** search
- unit BorDebugDumpScanner;
-
- interface
-
- uses BorDebug, HVBorDebug, BorDebugScanners;
-
- type
- TDumpEvent = procedure (Sender: TObject; const Msg: string) of object;
- TDumpBorDebugScanner = class(TCustomBorDebugScanner)
- private
- FIndentCount: integer;
- FFirstDump: boolean;
- FOnDump: TDumpEvent;
- procedure ScanNameIndices(NameIndices: PNameIndices; NameCount: TItemCount);
- procedure ScanRegNameIndices(RegNameIndices: PRegNameIndices;
- StartEntries : PSegmentOffsets;
- LengthEntries : PByteCounts;
- RegNameCount : TItemCount);
- procedure Dump(S: string);
- procedure DumpFmt(const S: string; const Args: array of const);
- procedure DumpLn(const S: string);
- procedure DumpLnFmt(const S: string; const Args: array of const);
- procedure Indent;
- procedure Unindent;
- protected
- function WantTypeInfoForSymbol(SymbolInfo: TSymbolInfo; TypeIndex: TTypeIndex): boolean; override;
- function WantFieldList(const SubSection: TBorDebugSubSection;
- SymbolInfo: TSymbolInfo; const BorDebugType: TBorDebugType): boolean; override;
- procedure ScanSrcModuleSource(const SubSection: TBorDebugSubSection;
- SrcModule: TBorDebugSrcModule; SourceIndex: integer;
- SourceOffset: TFileOffset; NameIndex: TNameIndex;
- RangeCount: TItemCount; SourceFileEntry: TSourceFileEntry); override;
- procedure ScanSrcModuleRange(const SubSection: TBorDebugSubSection;
- SrcModule: TBorDebugSrcModule; RangeIndex: integer;
- RangeSegmentIndex: TSegmentIndex; RangeStart,
- RangeEnd: TSegmentOffset); override;
- procedure ScanSymbolTypeInfo(const SubSection: TBorDebugSubSection;
- SymbolInfo: TSymbolInfo; TypeInfo: TTypeInfo; var KeepIt: boolean); override;
- procedure ScanModuleSegment(const SubSection: TBorDebugSubSection;
- Module: TBorDebugModule; SegmentIndex: integer;
- const Segment: TModuleSegment); override;
- procedure ScanSrcModule(const SubSection: TBorDebugSubSection;
- SrcModule: TBorDebugSrcModule; var KeepIt: boolean); override;
- procedure ScanSymbolInfo(const SubSection: TBorDebugSubSection;
- SymbolInfo: TSymbolInfo; var KeepIt: boolean); override;
- procedure ScanModule(const SubSection: TBorDebugSubSection;
- Module: TBorDebugModule; var KeepIt: boolean); override;
- procedure ScanSubSection(SubSectionIndex: integer; const SubSection: TBorDebugSubSection); override;
- procedure ScanLineNumberOffset(LineNumber: TLineNumber;
- LineOffset: TSegmentOffset); override;
- procedure ScanSrcModuleSourceRange(RangeIndex: integer;
- Segment: TSegmentIndex; Starts, Ends: TSegmentOffset;
- LineNumberCount: TItemCount; LineNumberOffsets: TLineNumberOffsets); override;
- public
- property IndentCount: integer read FIndentCount;
- property FirstDump: boolean read FFirstDump;
- property OnDump: TDumpEvent read FOnDump write FOnDump;
- end;
-
- implementation
-
- uses Windows, SysUtils;
-
- procedure TDumpBorDebugScanner.Indent;
- begin
- Inc(FIndentCount, 1);
- FFirstDump := true;
- end;
-
- procedure TDumpBorDebugScanner.Unindent;
- begin
- Dec(FIndentCount, 1);
- FFirstDump := true;
- end;
-
- procedure TDumpBorDebugScanner.Dump(S: string);
- var
- i : integer;
- begin
- if FirstDump then
- for i := 1 to IndentCount do
- S := ' ' + S;
- if Assigned(FOnDump) then
- FOnDump(Self, S);
- FFirstDump := false;
- end;
-
- procedure TDumpBorDebugScanner.DumpLn(const S: string);
- begin
- Dump(S+#13#10);
- FFirstDump := true;
- end;
-
- procedure TDumpBorDebugScanner.DumpFmt(const S: string; const Args: array of const);
- begin
- Dump(Format(S, Args));
- end;
-
- procedure TDumpBorDebugScanner.DumpLnFmt(const S: string; const Args: array of const);
- begin
- DumpLn(Format(S, Args));
- end;
-
- function TDumpBorDebugScanner.WantFieldList(const SubSection: TBorDebugSubSection; SymbolInfo: TSymbolInfo; const BorDebugType: TBorDebugType): boolean;
- begin
- case SymbolInfo.Kind of
- BORDEBUG_S_PCONSTANT,
- BORDEBUG_S_BPREL32 : Result := False;
- else Result := True;
- end;
- end;
-
- function TDumpBorDebugScanner.WantTypeInfoForSymbol(
- SymbolInfo: TSymbolInfo; TypeIndex: TTypeIndex): boolean;
- begin
- case SymbolInfo.Kind of
- BORDEBUG_S_PCONSTANT: Result := False;
- else Result := True;
- end;
- end;
-
- procedure TDumpBorDebugScanner.ScanModuleSegment(
- const SubSection: TBorDebugSubSection;
- Module: TBorDebugModule;
- SegmentIndex: integer;
- const Segment: TModuleSegment);
- begin
- DumpFmt('%d.', [SegmentIndex]);
- case Segment.Flags of
- sfDataSegment : Dump(' (DS)');
- sfCodeSegment : Dump(' (CS)');
- end;
- DumpFmt(' Size = %d b', [Segment.Size]);
- DumpLn('');
- end;
-
- procedure TDumpBorDebugScanner.ScanLineNumberOffset(LineNumber: TLineNumber;
- LineOffset: TSegmentOffset);
- begin
- DumpLnFmt('#%d = @%.8x',
- [LineNumber, LineOffset]);
- inherited;
- end;
-
- procedure TDumpBorDebugScanner.ScanSrcModuleSourceRange(RangeIndex: integer;
- Segment: TSegmentIndex; Starts, Ends: TSegmentOffset;
- LineNumberCount: TItemCount; LineNumberOffsets: TLineNumberOffsets);
- begin
- DumpLnFmt('Range#%d, Segment=%d, Start=%.8x, End=%.8x, LineNumbers=%d',
- [RangeIndex, Segment, Starts, Ends, LineNumberCount]);
- Indent;
- inherited;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanSrcModuleRange(
- const SubSection: TBorDebugSubSection; SrcModule: TBorDebugSrcModule;
- RangeIndex: integer; RangeSegmentIndex: TSegmentIndex; RangeStart,
- RangeEnd: TSegmentOffset);
- begin
- DumpLnFmt('Range#%d, Segment=%d, Start=%.8x, End=%.8x',
- [RangeIndex, RangeSegmentIndex, RangeStart, RangeEnd]);
- Indent;
- inherited;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanSrcModuleSource(
- const SubSection: TBorDebugSubSection; SrcModule: TBorDebugSrcModule;
- SourceIndex: integer; SourceOffset: TFileOffset; NameIndex: TNameIndex;
- RangeCount: TItemCount; SourceFileEntry: TSourceFileEntry);
- begin
- DumpLnFmt('File#%d, %s, Offset=%.8x, RangeCount=%d, ',
- [SourceIndex, BorDebug.Names[NameIndex], SourceOffset, RangeCount]);
- Indent;
- inherited;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanSymbolTypeInfo(
- const SubSection: TBorDebugSubSection; SymbolInfo: TSymbolInfo;
- TypeInfo: TTypeInfo; var KeepIt: boolean);
- var
- i : integer;
- begin
- if TypeInfo.TypeIndex = 0 then
- Exit;
- DumpFmt('TYPE %s', [TypeInfo.KindAsString]);
- case TypeInfo.TypeKind of
- BORDEBUG_LF_MODIFIER :
- with TypeInfo.Info.MODIFIERType^ do
- DumpFmt(', Attributes=%d, TypeIndex=%d: %s',
- [Ord(Attributes), TypeIndex, BorDebug.TypeName[TypeIndex]]);
- BORDEBUG_LF_POINTER :
- with TypeInfo.Info.POINTERType^ do
- DumpFmt(', Attributes=%d, TypeIndex=%d: %s, Value1=%d, Value2=%d',
- [Ord(Attributes), TypeIndex, BorDebug.TypeName[TypeIndex], DWORD(Value1), DWORD(Value2)]);
- BORDEBUG_LF_ARRAY :
- with TypeInfo.Info.ARRAYType^ do
- DumpFmt(', ElementType=%s, IndexType=%s, Name=%s, Size=%d, Elements=%d',
- [BorDebug.TypeName[ElementType], BorDebug.TypeName[IndexType], BorDebug.Names[NameIndex], Size, Elements ]);
- BORDEBUG_LF_STRUCT,
- BORDEBUG_LF_CLASS :
- with TypeInfo.Info.CLASSType^ do
- begin
- DumpFmt(', %s, Fields=%d, Size=%d, Flags=%s',
- [BorDebug.Names[NameIndex], FieldCount, ClassSize, ClassFlagsToString(ClassFlags)]);
- if ContainingClass <> 0 then
- DumpFmt(', Contained in class: %s', [BorDebug.TypeName[ContainingClass]]);
- Indent;
- ScanSymbolTypeTree(SubSection, SymbolInfo, FieldList);
- ScanSymbolTypeTree(SubSection, SymbolInfo, DerivationList);
- ScanSymbolTypeTree(SubSection, SymbolInfo, VTable);
- UnIndent;
- end;
- BORDEBUG_LF_UNION :
- with TypeInfo.Info.UNIONType^ do
- begin
- DumpFmt(', %s, Fields=%d, Size=%d, Flags=%s',
- [BorDebug.Names[NameIndex], FieldCount, ClassSize, ClassFlagsToString(ClassFlags)]);
- if ContainingClass <> 0 then
- DumpFmt(', Contained in class: %s', [BorDebug.TypeName[ContainingClass]]);
- Indent;
- ScanSymbolTypeTree(SubSection, SymbolInfo, FieldList);
- UnIndent;
- end;
- BORDEBUG_LF_ENUM :
- with TypeInfo.Info.ENUMType^ do
- begin
- DumpFmt(', %s, Members=%d, UnderlyingType=%s',
- [BorDebug.Names[NameIndex], MemberCount, BorDebug.TypeName[UnderlyingType]]);
- if ContainingClass <> 0 then
- DumpFmt(', Contained in class: %s', [BorDebug.TypeName[ContainingClass]]);
- Indent;
- ScanSymbolTypeTree(SubSection, SymbolInfo, MemberList);
- UnIndent;
- end;
- BORDEBUG_LF_PROCEDURE :
- with TypeInfo.Info.PROCEDUREType^ do
- begin
- DumpFmt(', ReturnType=%s, CallConv=%s, Args=%d',
- [BorDebug.TypeName[ReturnType], CallingConventionToString(CallingConvention), ArgCount]);
- Indent;
- ScanSymbolTypeTree(SubSection, SymbolInfo, ArgList);
- UnIndent;
- end;
- BORDEBUG_LF_MFUNCTION :
- with TypeInfo.Info.MFUNCTIONType^ do
- begin
- DumpFmt(', ReturnType=%s, CallConv=%s, Args=%d, ClassType=%s, ThisAdjust=%.8x',
- [BorDebug.TypeName[ReturnType], CallingConventionToString(CallingConvention), ArgCount, BorDebug.TypeName[ClassType], ThisAdjust]);
- if ClassType = 0 then
- Dump(', static')
- else
- DumpFmt(', ClassType=%s',
- [BorDebug.TypeName[ClassType]]);
- end;
- BORDEBUG_LF_VTSHAPE :
- with TypeInfo.Info.VTSHAPEType^ do
- begin
- DumpFmt(', DescriptorCount=%.8x',
- [DescriptorCount]);
- Indent;
- for i := 0 to DescriptorCount-1 do
- DumpFmt(' %d,', [DWORD(DescriptorArray^[i])]);
- UnIndent;
- end;
- BORDEBUG_LF_LABEL :
- with TypeInfo.Info.LABELType^ do
- DumpFmt(', NearFar=%.8x',
- [Ord(NearFar)]);
- BORDEBUG_LF_SET :
- with TypeInfo.Info.SETType^ do
- DumpFmt(', %s, ElemType=%s, LowByte=%d, Length=%d',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[ElemType], LowByte, Length]);
- BORDEBUG_LF_SUBRANGE :
- with TypeInfo.Info.SUBRANGEType^ do
- DumpFmt(', %s, BaseType=%s, LoBound=%d, HiBound=%d, Size=%d',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[BaseType], LoBound, HiBound, Size]);
- BORDEBUG_LF_PARRAY :
- with TypeInfo.Info.PARRAYType^ do
- DumpFmt(', %s, ElementType=%s, IndexType=%s, Size=%d, Elements=%d',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[ElementType], BorDebug.TypeName[IndexType], Size, Elements]);
- BORDEBUG_LF_PSTRING :
- with TypeInfo.Info.PSTRINGType^ do
- DumpFmt(', %s, ElemType=%s, IndexType=%s',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[ElemType], BorDebug.TypeName[IndexType]]);
- BORDEBUG_LF_CLOSURE :
- with TypeInfo.Info.CLOSUREType^ do
- begin
- DumpFmt(', ReturnType=%s, CallConv=%s, Args=%d',
- [BorDebug.TypeName[ReturnType], CallingConventionToString(CallingConvention), ArgCount]);
- Indent;
- ScanSymbolTypeTree(SubSection, SymbolInfo, ArgList);
- UnIndent;
- end;
- BORDEBUG_LF_PROPERTY :
- with TypeInfo.Info.PROPERTYType^ do
- begin
- DumpFmt(', Type=%s, Flags=%s, ArrayIndex=%d, PropIndex=%d',
- [BorDebug.TypeName[TypeIndex], PropertyFlagsToString(Flags), ArrayIndex, PropIndex]);
- if pfReadIsName in Flags then
- DumpFmt(', ReadSlot=%s', [BorDebug.Names[ReadSlot.NameIndex]])
- else
- DumpFmt(', ReadSlot=%d', [BorDebug.Names[ReadSlot.FieldOffset]]);
-
- if pfWriteIsName in Flags then
- DumpFmt(', WriteSlot=%s', [BorDebug.Names[WriteSlot.NameIndex]])
- else
- DumpFmt(', WriteSlot=%d', [BorDebug.Names[WriteSlot.FieldOffset]]);
- end;
- BORDEBUG_LF_LSTRING :
- with TypeInfo.Info.LSTRINGType^ do
- DumpFmt(', ''%s''',
- [BorDebug.Names[NameIndex]]);
- BORDEBUG_LF_VARIANT :
- with TypeInfo.Info.VARIANTType^ do
- DumpFmt(', ''%s''',
- [BorDebug.Names[NameIndex]]);
- BORDEBUG_LF_CLASSREF :
- with TypeInfo.Info.CLASSREFType^ do
- DumpFmt(', Class=%s, VtShape=%s',
- [BorDebug.TypeName[RefType], BorDebug.TypeName[VtShape]]);
- BORDEBUG_LF_WSTRING :
- with TypeInfo.Info.LSTRINGType^ do
- DumpFmt(', ''%s''',
- [BorDebug.Names[NameIndex]]);
- BORDEBUG_LF_ARGLIST :
- with TypeInfo.Info.ARGLISTType^ do
- begin
- DumpFmt(', TypeCount=%.8x',
- [TypeCount]);
- Indent;
- for i := 0 to TypeCount-1 do
- DumpFmt(' %s,', [BorDebug.TypeName[TypeArray^[i]]]);
- UnIndent;
- end;
- BORDEBUG_LF_DERIVED :
- with TypeInfo.Info.DERIVEDType^ do
- begin
- DumpFmt(', TypeCount=%.8x',
- [TypeCount]);
- Indent;
- for i := 0 to TypeCount-1 do
- DumpFmt(' %s,', [BorDebug.TypeName[DerivedTypes^[i]]]);
- UnIndent;
- end;
- BORDEBUG_LF_BITFIELD :
- with TypeInfo.Info.BITFIELDType^ do
- DumpFmt(', Type=%s, Length=%d, Position=%d',
- [BorDebug.TypeName[TypeIndex], Length, Position]);
- BORDEBUG_LF_METHODLIST :
- with TypeInfo.Info.METHODLISTType^ do
- begin
- DumpFmt(', MethodCount=%.8x',
- [MethodCount]);
- Indent;
- for i := 0 to MethodCount-1 do
- DumpLnFmt('Type=%s, Attrib=%s, VTabOff=%.8x',
- [BorDebug.TypeName[TypeArray^[i]], ClassMemberAttribToString(AttribArray^[i]), VtabOffArray^[i]]);
- UnIndent;
- end;
- BORDEBUG_LF_BCLASS :
- with TypeInfo.Info.BCLASSType^ do
- DumpFmt(', Type=%s, Attrib=%s, Offset=%.8x',
- [BorDebug.TypeName[BaseType], ClassMemberAttribToString(Attrib), Offset]);
- BORDEBUG_LF_VBCLASS :
- with TypeInfo.Info.VBCLASSType^ do
- DumpFmt(', vbType=%s, vbpType=%s, Attrib=%s, Offset=%.8x, VbpOffset=%.8x',
- [BorDebug.TypeName[vbType], BorDebug.TypeName[vbpType], ClassMemberAttribToString(Attrib), Offset, VbpOffset]);
- BORDEBUG_LF_IVBCLASS :
- with TypeInfo.Info.IVBCLASSType^ do
- DumpFmt(', vbType=%s, vbpType=%s, Attrib=%s, Offset=%.8x, VbpOffset=%.8x',
- [BorDebug.TypeName[vbType], BorDebug.TypeName[vbpType], ClassMemberAttribToString(Attrib), Offset, VbpOffset]);
- BORDEBUG_LF_ENUMERATE :
- with TypeInfo.Info.ENUMERATEType^ do
- DumpFmt(', Name=%s, Value=%d',
- [BorDebug.Names[NameIndex], Value]);
- BORDEBUG_LF_FRIENDFCN :
- with TypeInfo.Info.FRIENDFCNType^ do
- DumpFmt(', %s:%s',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex]]);
- BORDEBUG_LF_INDEX :
- with TypeInfo.Info.INDEXTypeR^ do
- DumpFmt(', Type=%s',
- [BorDebug.TypeName[TypeIndex]]);
- BORDEBUG_LF_MEMBER :
- with TypeInfo.Info.MEMBERType^ do
- DumpFmt(', %s:%s, Attrib=%s, Offset=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], ClassMemberAttribToString(Attrib), Offset]);
- BORDEBUG_LF_STMEMBER :
- with TypeInfo.Info.STMEMBERType^ do
- DumpFmt(', %s:%s, Attrib=%s',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], ClassMemberAttribToString(Attrib)]);
- BORDEBUG_LF_METHOD :
- with TypeInfo.Info.METHODType^ do
- begin
- DumpFmt(', Name=%s, OverloadedCount=%d',
- [BorDebug.Names[NameIndex], OverloadedCount]);
- Indent;
- ScanSymbolTypeTree(SubSection, SymbolInfo, MethodList);
- UnIndent;
- end;
- BORDEBUG_LF_NESTTYPE :
- with TypeInfo.Info.NESTTYPEType^ do
- DumpFmt(', %s:%s',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex]]);
- BORDEBUG_LF_VFUNCTAB :
- with TypeInfo.Info.VFUNCTABType^ do
- DumpFmt(', Type=%s, Offset=%.8x',
- [BorDebug.TypeName[TypeIndex], Offset]);
- BORDEBUG_LF_FRIENDCLS :
- with TypeInfo.Info.FRIENDCLSType^ do
- DumpFmt(', Type=%s',
- [BorDebug.TypeName[TypeIndex]]);
- BORDEBUG_LF_CHAR :
- with TypeInfo.Info.CHARType^ do DumpFmt(', Value=%s', [Value]);
- BORDEBUG_LF_SHORT :
- with TypeInfo.Info.SHORTType^ do
- DumpFmt(', Value=%d',
- [Value]);
- BORDEBUG_LF_USHORT : with TypeInfo.Info.USHORTType^ do DumpFmt(', Value=%d', [Value]);
- BORDEBUG_LF_LONG : with TypeInfo.Info.LONGType^ do DumpFmt(', Value=%d', [Value]);
- BORDEBUG_LF_ULONG : with TypeInfo.Info.ULONGType^ do DumpFmt(', Value=%d', [Value]);
- BORDEBUG_LF_REAL32 : with TypeInfo.Info.REAL32Type^ do DumpFmt(', Value=%g', [Value]);
- BORDEBUG_LF_REAL64 : with TypeInfo.Info.REAL64Type^ do DumpFmt(', Value=%g', [Value]);
- BORDEBUG_LF_REAL80 : with TypeInfo.Info.REAL80Type^ do DumpFmt(', Value=%g', [Value]);
- BORDEBUG_LF_QUADWORD : with TypeInfo.Info.QUADWORDType^ do DumpFmt(', Value=%d', [Value]);
- BORDEBUG_LF_UQUADWORD: with TypeInfo.Info.UQUADWORDType^ do DumpFmt(', Value=%d', [Value]);
- BORDEBUG_LF_REAL48 : with TypeInfo.Info.REAL48Type^ do DumpFmt(', Value=%g', [Value]);
- end;
- DumpLn('');
- Indent;
- inherited;
- UnIndent;
- end;
-
-
- procedure TDumpBorDebugScanner.ScanSrcModule(const SubSection: TBorDebugSubSection;
- SrcModule: TBorDebugSrcModule; var KeepIt: boolean);
- begin
- with SrcModule do
- DumpLnFmt('SRCMODULE (%.8x): %d Range(s), %d Sourcefile(s), %',
- [Offset, RangeCount, SourceCount]);
- Indent;
- inherited;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanNameIndices(NameIndices: PNameIndices; NameCount: TItemCount);
- var
- i : integer;
- begin
- Indent;
- DumpLn('');
- for i := 0 to NameCount-1 do
- begin
- Dump(BorDebug.Names[NameIndices^[i]]);
- if i < NameCount-1 then
- DumpLn(',')
- else
- Dump(';')
- end;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanRegNameIndices(RegNameIndices: PRegNameIndices;
- StartEntries : PSegmentOffsets;
- LengthEntries : PByteCounts;
- RegNameCount : TItemCount);
- var
- i : integer;
- begin
- Indent;
- DumpLn('');
- for i := 0 to RegNameCount-1 do
- begin
- DumpFmt('Reg: %s, Start=%.8x, Length=%.8x',
- [BorDebug.RegisterName[RegNameIndices^[i]], StartEntries^[i], LengthEntries^[i]]);
- if i < RegNameCount-1 then
- DumpLn('');
- end;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanSymbolInfo(const SubSection: TBorDebugSubSection;
- SymbolInfo: TSymbolInfo; var KeepIt: boolean);
- begin
- if SymbolInfo.Kind = BORDEBUG_S_END then
- UnIndent
- else
- DumpFmt('SYMBOL: %s', [SymbolInfo.KindAsString]);
- case SymbolInfo.Kind of
- BORDEBUG_S_COMPILE :
- with SymbolInfo.Info.COMPILESymbol^ do
- DumpFmt(', Machine=%d, Language=%d, Flags=%.8x, Compiler=%s',
- [Ord(Machine), Ord(Language), Flags, CompilerName]);
- BORDEBUG_S_REGISTER :
- with SymbolInfo.Info.REGISTERSymbol^ do
- DumpFmt(', Type=%s, Register=%s, Name=%s',
- [BorDebug.TypeName[TypeIndex], BorDebug.RegisterName[RegisterIndex], BorDebug.Names[NameIndex]]);
- BORDEBUG_S_CONST :
- with SymbolInfo.Info.CONSTSymbol^ do
- DumpFmt(', %s:%s = %.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Value]);
- BORDEBUG_S_UDT :
- with SymbolInfo.Info.UDTSymbol^ do
- begin
- DumpFmt(' %s: %s',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex]]);
- if udtTag in Properties then
- Dump(', Tag');
- if udtNested in Properties then
- Dump(', Nested');
- end;
- BORDEBUG_S_SSEARCH :
- with SymbolInfo.Info.SSEARCHSymbol^ do
- DumpFmt(', FirstProcSegment=%d, FirstProcOffset=%.8x, CodeSymCount=%d, DataSymCount=%d, FirstData=%.8x',
- [FirstProcSegment, FirstProcOffset, CodeSymCount, DataSymCount, FirstData]);
- BORDEBUG_S_OBJNAME :
- with SymbolInfo.Info.OBJNAMESymbol^ do
- DumpFmt(', Name=%s, Signature=%.8x',
- [BorDebug.Names[NameIndex], Signature]);
- BORDEBUG_S_USES :
- with SymbolInfo.Info.USESSymbol^ do
- ScanNameIndices(NameIndices, NameCount);
- BORDEBUG_S_USING :
- with SymbolInfo.Info.USINGSymbol^ do
- ScanNameIndices(NameIndices, NameCount);
- BORDEBUG_S_PCONSTANT :
- with SymbolInfo.Info.PCONSTANTSymbol^ do
- DumpFmt(', %s: %s = %s',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Value]); // Properties
- BORDEBUG_S_NAMESPACE :
- with SymbolInfo.Info.NAMESPACESymbol^ do
- begin
- DumpFmt(', Name=%s',
- [BorDebug.Names[NameIndex]]);
- ScanNameIndices(UsingIndices, UsingCount);
- end;
- BORDEBUG_S_GPROCREF :
- with SymbolInfo.Info.GPROCREFSymbol^ do
- DumpFmt(', %s: %s; RefSymOffset=%.8x, CodeSegment=%d, CodeOffset=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], RefSymOffset, CodeSegment, CodeOffset]);
- BORDEBUG_S_GDATAREF :
- with SymbolInfo.Info.GDATAREFSymbol^ do
- DumpFmt(', %s: %s; RefSymOffset=%.8x, DataSegment=%d, DataOffset=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], RefSymOffset, DataSegment, DataOffset]);
- BORDEBUG_S_LPROC32 :
- with SymbolInfo.Info.LPROC32Symbol^ do
- begin
- DumpLnFmt(', %s: %s; Flags=%.8x, Offset=%.8x, Segment=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Flags, Offset, Segment]);
- DumpFmt(' Parent=%.8x, End_=%.8x, Next=%.8x, CodeLength=%.8x, DebugStart=%.8x, DebugEnd=%.8x',
- [Parent, End_, Next, CodeLength, DebugStart, DebugEnd]);
- Indent;
- end;
- BORDEBUG_S_GPROC32 :
- with SymbolInfo.Info.GPROC32Symbol^ do
- begin
- DumpLnFmt(', %s: %s; Flags=%.8x, Offset=%.8x, Segment=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Flags, Offset, Segment]);
- DumpFmt(' Parent=%.8x, End_=%.8x, Next=%.8x, CodeLength=%.8x, DebugStart=%.8x, DebugEnd=%.8x',
- [Parent, End_, Next, CodeLength, DebugStart, DebugEnd]);
- if Assigned(LinkName) then
- DumpFmt(', LinkName=%s', [string(LinkName)]);
- Indent;
- end;
- BORDEBUG_S_GDATA32 :
- with SymbolInfo.Info.GDATA32Symbol^ do
- begin
- DumpFmt(', %s: %s; Offset=%.8x, Segment=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Offset, Segment]);
- if Flags = efTLS then
- Dump(', TLS');
- end;
- BORDEBUG_S_OPTVAR32 :
- with SymbolInfo.Info.OPTVAR32Symbol^ do
- ScanRegNameIndices(RegNameEntries, StartEntries, LengthEntries, EntryCount);
- BORDEBUG_S_LDATA32 :
- with SymbolInfo.Info.LDATA32Symbol^ do
- begin
- DumpFmt(', %s: %s; Offset=%.8x, Segment=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Offset, Segment]);
- if Flags = efTLS then
- Dump(', TLS');
- end;
- BORDEBUG_S_EDATA :
- with SymbolInfo.Info.EDATASymbol^ do
- begin
- DumpFmt(', %s: %s; ExternIndex=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], ExternIndex]);
- if Flags = efTLS then
- Dump(', TLS');
- end;
- BORDEBUG_S_EPROC :
- with SymbolInfo.Info.EPROCSymbol^ do
- DumpFmt(', %s: %s; ExternIndex=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], ExternIndex]);
- BORDEBUG_S_BPREL32 :
- with SymbolInfo.Info.BPREL32Symbol^ do
- DumpFmt(', %s: %s; EBPOffset=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], EBPOffset]);
- BORDEBUG_S_PUB32 :
- with SymbolInfo.Info.PUB32Symbol^ do
- begin
- DumpFmt(', %s: %s; Offset=%.8x, Segment=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Offset, Segment]);
- if Flags = efTLS then
- Dump(', TLS');
- end;
- BORDEBUG_S_THUNK32 :
- with SymbolInfo.Info.THUNK32Symbol^ do
- DumpFmt(', %s; Offset=%.8x, Segment=%.8x, Parent=%.8x, End_=%.8x, Next=%.8x, CodeLength=%.8x, Ordinal=%.8x, Delta=%.8x',
- [BorDebug.Names[NameIndex], Offset, Segment, Parent, End_, Next, CodeLength, DWORD(Ordinal), Delta]);
- BORDEBUG_S_BLOCK32 :
- with SymbolInfo.Info.BLOCK32Symbol^ do
- DumpFmt(', %s; Offset=%.8x, Segment=%.8x, Parent=%.8x, End_=%.8x, CodeLength=%.8x',
- [BorDebug.Names[NameIndex], Offset, Segment, Parent, End_, CodeLength]);
- BORDEBUG_S_WITH32 :
- with SymbolInfo.Info.WITH32Symbol^ do
- DumpFmt(', %s: %s; Offset=%.8x, Segment=%.8x, Parent=%.8x, CodeLength=%.8x, VarOffset=%.8x',
- [BorDebug.Names[NameIndex], BorDebug.TypeName[TypeIndex], Offset, Segment, Parent, CodeLength, VarOffset]);
- BORDEBUG_S_LABEL32 :
- with SymbolInfo.Info.LABEL32Symbol^ do
- DumpFmt(', %s; Offset=%.8x, Segment=%.8x, NearFar=%.8x',
- [BorDebug.Names[NameIndex], Offset, Segment, Ord(NearFar)]);
- BORDEBUG_S_ENTRY32 :
- with SymbolInfo.Info.ENTRY32Symbol^ do
- DumpFmt(', Offset=%.8x, Segment=%.8x',
- [Offset, Segment]);
- BORDEBUG_S_PROCRET32 :
- with SymbolInfo.Info.PROCRET32Symbol^ do
- DumpFmt(', Offset=%.8x, Length=%.8x',
- [Offset, Length]);
- BORDEBUG_S_SAVREGS32 :
- with SymbolInfo.Info.SAVREGS32Symbol^ do
- DumpFmt(', Mask=%s, EBPOffset=%.8x',
- [SaveRegsToString(Mask), EBPOffset]);
- BORDEBUG_S_SLINK32 :
- with SymbolInfo.Info.SLINK32Symbol^ do
- DumpFmt(', EBPOffset=%.8x',
- [EBPOffset]);
- end;
- DumpLn('');
- Indent;
- inherited;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanModule(const SubSection: TBorDebugSubSection;
- Module: TBorDebugModule; var KeepIt: boolean);
- begin
- with Module do
- DumpLnFmt('MODULE: %s, Overlay=%d, LibIndex=%d, Style=%.8x, TimeStamp=%.8x, SegmentCount = %d',
- [Name, Overlay, LibIndex, Style, TimeStamp, SegmentCount]);
- Indent;
- inherited;
- UnIndent;
- end;
-
- procedure TDumpBorDebugScanner.ScanSubSection(SubSectionIndex: integer; const SubSection: TBorDebugSubSection);
- begin
- with SubSection do
- DumpLnFmt('SUBSECTION #%d: %s, ModuleIndex=%d, Offset=%.8x, Size=%d',
- [SubSectionIndex, SubsectionTypeToString(SubSection.SubsectionType), Module, Offset, Size]);
- Indent;
- inherited;
- UnIndent;
- end;
-
- end.
-